// 使用 fetch 发起 GET 请求
fetch('http://localhost:3000/mi/')
  .then(response => response.json())
  .then(data => {
    // console.log(data)
    const list = document.getElementById('product-content');
    console.log(list)
    data.forEach(item => {
      list.innerHTML += `
            <div class="goods">
            <div class="picture">
              <img src="${'http://localhost:3000/img/' + item.name}" alt="">
            </div>
            <div class="data">
              <b>${1}</b>
              <p class="txt1">第二代骁龙8 旗舰芯</p>
              <p class="txt2">￥${1}起</p>
              <div class="buy">立即购买</div>
            </div>
          </div>
        `
      // http://localhost:3000/img/swiper7.png
    });
  })
  .catch(error => console.error('Error:', error));

